#define _CRT_SECURE_NO_WARNINGS 1

#include"list.h"

void test1()
{
	xrw::list<int> lt;
	lt.push_back(1);
	lt.push_back(3);
	lt.push_back(5);

	xrw::list<int>::iterator it = lt.begin();

	while (it != lt.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;
	
}

void test2()
{
	xrw::list<int> lt;
	lt.push_back(1);
	lt.push_back(3);

	lt.push_front(6);
	for (auto a : lt)
	{
		cout << a << " ";
	}
	cout << endl;

	lt.pop_back();
	for (auto a : lt)
	{
		cout << a << " ";
	}
	cout << endl;

	lt.clear();

	for (auto a : lt)
	{
		cout << a << " ";
	}
	cout << endl;
}

void test3()
{
	xrw::list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	for (auto a : lt)
	{
		cout << a << " ";
	}
	cout << endl;
	xrw::list<int>lt1(lt);

	for (auto a : lt1)
	{
		cout << a << " ";
	}
	cout << endl;
}

void test4()
{
	xrw::list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(5);
	lt.push_back(6);
	lt.push_back(7);

	xrw::list<int>::reverse_itrator rit = lt.rbegin();
	while (rit != lt.rend())
	{
		cout << *rit << " ";
		++rit;
	}
	cout << endl;
}
int main()
{
	test4();
	return 0;
}